<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>jq-6</title>
		<script src="../js/jquery-3.6.3.min.js"></script>
		<script>
			$(function(){
				 let d=$("ul li");
				 //alert(d.length);
				 //li的字体越来越大
				 d.each(function(i,o){
					 //i是索引，d是元素
					 //console.log(i,o);
					 //o是dom元素
					 $(o).css({"font-size":(i*10+6)+"px"});
					 //默认返回true,返回false,则迭代结束
					 if(i>3)
					   return false;
				 });
				 let t=document.getElementById("t");
				 $(t).text("fruits:");
				 alert($("ul li").get(3).innerHTML);
				 $("ul li").get(3).innerHTML="哈密瓜";
				  $("ul li")[4].innerHTML="水蜜桃";
			});
		</script>
	</head>
	<body>
		<h1 id="t">好吃的水果</h1>
		<ul>
			<li>桃子</li>
			<li>狮子</li>
			<li>柿子</li>
			<li id="t4">花生</li>
			<li>xihongshi</li>
			<li>putao</li>
			<li>boluo</li>
		</ul>
		<div>
			<button type="button" id="b1">添加一个元素</button>
		</div>
	</body>
</html>